<meta http-equiv="Content-Type"
content="text/html;charset=UTF-8">

<?php
if (isset ($_REQUEST["køn"])){
}
echo " ";
if (isset ($_REQUEST["alder"])){
}
echo " ";
if (isset ($_REQUEST["gift"])){
}
?>

<form action="forsikringsberegner2.php">
<table border="1">
<tr>
<td><input type="radio" name="køn" value="mand" />Mand:
<br />
<input type="radio" name="køn" value="kvinde"/>Kvinde:</td>
</tr>
<br />
<tr>
<td>alder: <select name="alder" >
<?php
for($a = 18;$a<=100;$a++){
	echo "<option value=$a>$a</option>";
}
?>
</select></td>
</tr>
<br />
<tr>
<td><input type="checkbox" name="gift" />Gift:</td></tr>
<tr>
<td><input type="submit" /></td></tr>
</form>

<?php
if(isset($_REQUEST["alder"])){
	$alder = $_REQUEST["alder"];
	$køn = $_REQUEST["køn"];
	if(isset($_REQUEST["gift"])){
		$gift = "ja";
	}else{
			$gift = "nej";
	}
$pris = 500;
if ($alder < 25 && $køn == "mand" && $gift == "nej"){
	$pris = $pris + 1500;
}
elseif ($køn == "kvinde" || $gift == "ja"){
	$pris = $pris - 200;
}
elseif ($alder > 46 && $alder <64){
	$pris = $pris - 100;
}
echo("<tr>");
echo("<td>");
echo($pris);
echo("</td>");
echo("</tr>");
}
?>